<?php


namespace App\Common;

/**
 * 接口返回码常量定义
 *
 * @package App\Common
 * @author WangBin
 * @date 2021-06/11
 */
class ResponseCode
{
    // 通用返回码
    const SUCCESS = [200, '处理成功'];
    const FAIL = [500, '处理失败'];
    const PARAM_ILLEGAL = [500, '非法的参数%error'];
    const SAVE_FAIL = [500, '保存失败%error'];
    const JWT_MAKE_FAIL = [500, '生成token失败'];
    const API_AUTH_FAIL = [401, '请前往登录'];
    const API_AUTH_FORBIDDEN = [403, '暂无权限访问资源'];
    const OP_FAIL = [500, '操作失败'];
    const LOGIN_WAY_ERROR = [500, '不支持的登录场景'];
    const LOGIN_FAIL = [500, '用户名或密码错误'];
    const TIME_RANGE_ERROR = [500, '请填写正确时间区间'];

    // 业务返回码
    /*----------------------客户相关------------------------*/
    const CUSTOMER_USERNAME_REGISTERED = [500, '用户名已注册'];
    const CUSTOMER_PHONE_REGISTERED = [500, '手机号已注册'];
    const CUSTOMER_USERNAME_PWD_NOT_FOUND = [500, '账户或密码不正确'];
    const CUSTOMER_PWD_CONFIRM_FAIL = [500, '两次密码不一致'];
    const CUSTOMER_NOT_FOUND = [500, '客户不存在'];
    const CUSTOMER_PWD_ERROR = [500, '密码不正确'];
    const CUSTOMER_UPDATE_FAIL = [500, '客户信息更新失败'];
    const CUSTOMER_DELETE_FAIL = [500, '客户删除失败'];

    /*----------------------手机验证码相关------------------------*/
    const PHONE_FORMAT_ILLEGAL = [500, '手机号不合法'];
    const PHONE_CODE_BUSY = [500, '验证码频率过快'];
    const PHONE_CODE_TIMES_10 = [500, '当日发送已达10次'];
    const PHONE_CODE_ERROR = [500, '验证码不正确'];
    const PHONE_NOT_FOUND = [500, '请输入正确的手机号'];

    /*----------------------收货地址相关------------------------*/
    const ADDRESS_NOT_FOUND = [500, '地址不存在'];
    const ADDRESS_DEL_SUCCESS = [500, '地址已删除'];

    /*----------------------用户相关------------------------*/
    const USER_NOT_FOUND = [500, '用户不存在'];
    const USER_DELETE_FAIL = [500, '用户删除失败'];

    /*----------------------系统相关------------------------*/
    const BN_KEY_NOT_FOUND = [500, '编号Key不存在'];
    const FILE_UPLOAD_FAIL = [500, '文件上传失败'];
    const FILE_TYPE_ERROR = [500, '不支持的文件类型'];
    const GROUP_NOT_FOUND = [500, '分组不存在'];

    /*----------------------商品相关------------------------*/
    const CATEGORY_NOT_FOUND = [500, '分类不存在'];
    const BRAND_NOT_FOUND = [500, '品牌不存在'];
    const GOODS_NOT_FOUND = [500, '商品不存在'];
    const GOODS_SAVE_FAIL = [500, '商品保存失败!%error'];
    const GOODS_ID_EMPTY = [500, '商品ID为空'];
    const CATEGORY_DELETE_FAIL = [500, '分类删除失败'];
    const CATEGORY_HAS_CHILD = [500, '分类下有子分类'];
    const GOODS_ADD_FAVORITE_FAIL = [500, '加入收藏失败'];
    const GOODS_HAS_FAVORITE = [500, '商品已被收藏'];
    const GOODS_CANCEL_FAVORITE = [500, '取消收藏失败'];
    const GOODS_SPEC_UPDATE_FAIL = [500, '保存规格失败'];
    const GOODS_SPEC_NOT_FOUND = [500, '规格不存在'];
    const GOODS_SPEC_NAME_EXIST = [500, '规格名已存在'];
    const GOODS_SPEC_BN_EXIST = [500, '规格编号已存在'];
    const GOODS_SPEC_DELETE_FAIL = [500, '规格删除失败'];
    const GOODS_ATTR_UPDATE_FAIL = [500, '保存属性失败'];
    const GOODS_ATTR_NOT_FOUND = [500, '属性不存在'];
    const GOODS_ATTR_NAME_EXIST = [500, '属性名已存在'];
    const GOODS_ATTR_BN_EXIST = [500, '属性编号已存在'];
    const GOODS_ATTR_DELETE_FAIL = [500, '属性删除失败'];
    const GOODS_ATTR_ENABLE_FAIL = [500, '属性停/启用失败'];
    const BRAND_UPDATE_FAIL = [500, '品牌保存失败'];
    const TAG_NOT_FOUND = [500, '标签不存在'];
    const TAG_UPDATE_FAIL = [500, '标签保存出错'];
    const GOODS_SPEC_VAL_DELETE_FAIL = [500, '规格值删除出错'];

    /*----------------------购物车相关------------------------*/
    const CART_SAVE_FAIL = [500, '加购失败%error'];
    const CART_ERROR = [500, '获取购物车失败'];
    const CART_UPDATE_FAIL = [500, '购物车更新出错%error'];

    /*----------------------订单相关------------------------*/
    const ORDER_CREATE_FAIL = [500, '订单创建失败%error'];
    const ORDER_NOT_FOUND = [500, '订单不存在'];
    const ORDER_CANCEL_FAIL = [500, '订单取消失败'];
    const ORDER_STATUS_NOT_CANCEL = [500, '订单不可取消'];
    const ORDER_DELETE_FAIL = [500, '订单删除失败'];
    const ORDER_STATUS_NOT_DELETE = [500, '订单不可删除'];
    const ORDER_STATUS_NOT_RECEIPT = [500, '订单不可收货'];
    const ORDER_STATUS_NOT_COMMENT = [500, '订单已评论'];

    /*----------------------支付相关------------------------*/
    const PAY_METHOD_NOT_FOUND = [500, '暂不支持的支付方式'];
    const PAY_ORDER_NOT_FOUND = [500, '未查询到待支付订单'];
    const PAY_FAIL = [500, '订单支付失败%error'];
    const PAYMENT_NOT_FOUND = [500, '支付方式不存在'];
    const PAYMENT_KEY_EXIST = [500, '支付方式key已存在'];

    /*----------------------发货物流相关------------------------*/
    const DELIVERY_CREATE_FAIL = [500, '发货失败'];
    const DELIVERY_ORDER_STATUS_ERROR = [500, '发货出错（订单状态不可发货）'];
    const DELIVERY_EXPRESS_BN_EXIST = [500, '发货出错（物流编号已存在）'];
    const DELIVERY_COMPANY_NOT_EXIST = [500, '发货出错（物流公司不存在）'];

    /*----------------------角色相关------------------------*/
    const ROLE_NOT_FOUND = [500, '角色不存在'];
    const ROLE_DELETE_FAIL = [500, '角色删除失败'];
    const ROLE_UPDATE_FAIL = [500, '角色保存失败'];
    const ROLE_BN_EXIST = [500, '角色编号已存在'];
    const ROLE_BIND_RESOURCE_FAIL = [500, '绑定资源失败'];
    const ROLE_BIND_MENU_FAIL = [500, '绑定菜单失败'];

    /*----------------------资源相关------------------------*/
    const RESOURCE_NOT_FOUND = [500, '资源不存在'];
    const RESOURCE_UPDATE_FAIL = [500, '资源保存出错'];
    const MENU_DELETE_FAIL = [500, '菜单删除失败'];

    /*----------------------菜单相关------------------------*/
    const MENU_UPDATE_FAIL = [500, '菜单保存失败'];
    const MENU_NOT_FOUND = [500, '菜单不存在'];
    const MENU_DELETE_PARENT_FAIL = [500, '请先删除父菜单'];

    /*----------------------营销相关------------------------*/
    const COUPON_UPDATE_FAIL = [500, '优惠券保存失败'];
    const COUPON_NOT_FOUND = [500, '优惠券不存在'];
    const SECKILL_NOT_FOUND = [500, '秒杀活动不存在'];
    const SECKILL_NOT_ACCESS = [500, '秒杀活动不可用'];
    const SECKILL_NOT_START = [500, '秒杀活动未开始'];
    const SECKILL_HAS_END = [500, '秒杀活动已结束'];
    const SECKILL_STOCK_EMPTY = [500, '手速太慢，已被抢光'];

    /*----------------------账户相关------------------------*/
    const ACCOUNT_PLAN_ERROR = [500, '充值套餐不存在'];
    const ACCOUNT_RECHARGE_AMOUNT_ERROR = [500, '单次充值金额需小于 1000 元'];
    const ACCOUNT_RECHARGE_FAIL = [500, '充值失败'];

    /*----------------------售后相关------------------------*/
    const AFTERSALES_APPLY_FORBIDDEN_FAIL = [500, '不支持申请售后'];
    const AFTERSALES_APPLY_FAIL = [500, '申请售后失败'];
    const AFTERSALES_APPLY_NOT_FOUND = [500, '售后申请单不存在'];
    const AFTERSALES_APPLY_AUDIT_ERROR = [500, '售后申请单不能审核'];
}
